Mixed-effects modelling in 6 weeks
Overall objective
To understand key concepts in building mixed-effects models
To test the understanding with the data of the priming study
Weekly Objectives
Week 0: How to use R project and how to input the dataset
Week 1: When to use mixed-effects modelling or multilevel modelling (MLM), as opposed to traditional multiple regression
Week 3: Multilevel data structure
Week 5: How to interpret the results and how to build models
Week 6: Reporting practice
Line.icon
Week 0: How to use R project and how to input the dataset
Free online resources
line.icon
Week 1: When to use mixed-effects modelling or multilevel modelling (MLM), vs. traditional multiple regression
Reading
Notes
Repeated measurements violates the assumption of traditional linear regression—"independence of observations", meaning that there is some additional, systematic variation of the effects of predictor variable(s) by the repeating/grouping factors.
line.icon
https://gyazo.com/5585601abd3bd5a6b87ac6d159250fda
line.icon
Week 3: Multilevel data structure
Reading
Notes
Nested or Crossed, or Partially crossed
Concept of "Level": Lowest = Level 1, Second lowest = Level 2 ...
e.g., Level 1 = Individuals, Level 2 = Department, Level 3 = University
https://gyazo.com/0604f799f68b421f01fb96e0eab3b8b8
code:Fully nested mixed effects
lmer(response ~ predictor + (1|School/Class)
Longitudinal data usually takes this data structure—Multiple measurements at different time points are nested within the individuals
https://gyazo.com/c7784a80c261204ac4a2225d082af1e4
code:Crossed random effects
lmer ~ predictor + (1|school) + (1|class)
Note: dependency across levels in fully nested models
Tips: if not nested = crossed
https://gyazo.com/58e113a77f02b6ea6486ab312e9ff591
line.icon
line.icon
Week 5: How to interpret the results and how to build models
Random-effects structure
Random-effects structure = "which treatment effects are assumed to vary across which sampled units, and how they are assumed to vary."
Nonconverging LMEMs were dealt with by progressively simplifying the random effects structure until convergence was reached.
https://gyazo.com/ff1faac43f1da222c47a0a501cfc0aff
Models testing interactions in designs with replications should include random slopes for the highest-order combination of within-unit factors subsumed by each interaction.
shungosuzuki.icon Here, replication = "multiple observations per sampling unit per cell"
Non-replicated = "If observations are not replicated (i.e., there is only a single observation per unit per cell), random slope variance cannot be distinguished from random error variance and thus random slopes need not be included."
In cases where a full random effects structure model did not converge, we first took out the interactions between random slopes, and then gradually removed random slopes that accounted for the least variance until a converged model was obtained.
line.icon
Week 6: Reporting practice